/* 基础样式设置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: #333;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background-color: #f9f9f9;
}

header {
    text-align: center;
    margin-bottom: 40px;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

h1 {
    color: #2c3e50;
    margin-bottom: 10px;
}

.box-demo {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 50px;
    flex-wrap: wrap;
}

/* 标准盒子模型 */
.standard-box {
    width: 200px;
    height: 150px;
    padding: 20px;
    border: 5px solid #3498db;
    margin: 20px;
    background-color: #ecf0f1;
    text-align: center;
    border-radius: 4px;
}

/* border-box盒子模型 */
.border-box {
    width: 200px;
    height: 150px;
    padding: 20px;
    border: 5px solid #e74c3c;
    margin: 20px;
    background-color: #fadbd8;
    text-align: center;
    border-radius: 4px;
    box-sizing: border-box; /* 使用border-box模型 */
}

.calculation {
    font-weight: bold;
    margin-top: 10px;
    color: #2c3e50;
}

.explanation {
    background-color: #fff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.explanation h3 {
    margin-bottom: 15px;
    color: #2c3e50;
}

.explanation ul {
    list-style-position: inside;
}

.explanation li {
    margin-bottom: 10px;
}

/* 用不同颜色标识盒子模型的各个部分 */
.content {
    background-color: #2ecc71;
    color: white;
    padding: 2px 5px;
    border-radius: 3px;
}

.padding {
    background-color: #3498db;
    color: white;
    padding: 2px 5px;
    border-radius: 3px;
}

.border {
    background-color: #9b59b6;
    color: white;
    padding: 2px 5px;
    border-radius: 3px;
}

.margin {
    background-color: #f39c12;
    color: white;
    padding: 2px 5px;
    border-radius: 3px;
}

footer {
    text-align: center;
    margin-top: 50px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
    color: #7f8c8d;
}
